<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
</head>
<body>

<div id="app"> 
  <cpn v-show="isShow"></cpn>
</div>
  
<template id="cpn">
    <div>
        <h2>我是子组件</h2>
        <p>我是内容，哈哈哈</p>
        <button v-show="isShow">按钮</button>
    </div>
</template>

<script src="../js/vue.js"></script>
<script>
  const app = new Vue({
    el: '#app',//用于挂载要管理的元素
    data: {
      message: '你好啊',
      isShow: true
    },
    components: {
        cpn: {
            template: '#cpn',
            data() {
                return {
                    isShow: false
                }
            }
        }
    }
  })
</script>

</body>
</html>